package com.huaxin.device.models;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

/**
 * 设备数据采集表 - 宽表模式实体类
 */
@Data
@TableName("device_data_collection_wide")
@EqualsAndHashCode(callSuper = true)
public class DeviceDataCollectionWide extends BaseModel {

    @TableField(value = "family_id")
    @Schema(description = "家庭ID", example = "1")
    private String familyId;
    /**
     * 设备类型: 10KV电力监测仪表, 0.4KV电力监测仪表, 配电房环境监测, 微机保护,
     * 有源信号监测模块, 无源信号监测模块, 变压器温控仪, 无线测温主机
     */
    @TableField(value = "device_type")
    private String deviceType;

    /**
     * 设备Id
     */
    @TableField(value = "device_id")
    private Long deviceId;

    /**
     * A相电压 (kV)
     */
    @TableField(value = "voltage_a_kv")
    private BigDecimal voltageAKv;

    /**
     * B相电压 (kV)
     */
    @TableField(value = "voltage_b_kv")
    private BigDecimal voltageBKv;

    /**
     * C相电压 (kV)
     */
    @TableField(value = "voltage_c_kv")
    private BigDecimal voltageCKv;

    /**
     * AB线电压 (kV)
     */
    @TableField(value = "voltage_ab_kv")
    private BigDecimal voltageAbKv;

    /**
     * BC线电压 (kV)
     */
    @TableField(value = "voltage_bc_kv")
    private BigDecimal voltageBcKv;

    /**
     * CA线电压 (kV)
     */
    @TableField(value = "voltage_ca_kv")
    private BigDecimal voltageCaKv;

    /**
     * A相电流 (A)
     */
    @TableField(value = "current_a_a")
    private BigDecimal currentAA;

    /**
     * B相电流 (A)
     */
    @TableField(value = "current_b_a")
    private BigDecimal currentBA;

    /**
     * C相电流 (A)
     */
    @TableField(value = "current_c_a")
    private BigDecimal currentCA;

    /**
     * 总功率因数
     */
    @TableField(value = "power_factor_total")
    private BigDecimal powerFactorTotal;

    /**
     * 总有功功率 (kW)
     */
    @TableField(value = "active_power_total_kw")
    private BigDecimal activePowerTotalKw;

    /**
     * 总无功功率 (kvar)
     */
    @TableField(value = "reactive_power_total_kvar")
    private BigDecimal reactivePowerTotalKvar;

    /**
     * 总视在功率 (kVA)
     */
    @TableField(value = "apparent_power_total_kva")
    private BigDecimal apparentPowerTotalKva;

    /**
     * 正向有功电度 (kWh)
     */
    @TableField(value = "energy_active_forward_kwh")
    private BigDecimal energyActiveForwardKwh;

    /**
     * 正向无功电度 (kWh)
     */
    @TableField(value = "energy_reactive_forward_kwh")
    private BigDecimal energyReactiveForwardKwh;

    /**
     * 反向有功电度 (kWh)
     */
    @TableField(value = "energy_active_reverse_kwh")
    private BigDecimal energyActiveReverseKwh;

    /**
     * 反向无功电度 (kWh)
     */
    @TableField(value = "energy_reactive_reverse_kwh")
    private BigDecimal energyReactiveReverseKwh;

    /**
     * 频率 (Hz)
     */
    @TableField(value = "frequency_hz")
    private BigDecimal frequencyHz;

    /**
     * 烟雾告警: 0-正常, 1-告警
     */
    @TableField(value = "alarm_smoke")
    private Integer alarmSmoke;

    /**
     * 人员入侵告警: 0-正常, 1-告警
     */
    @TableField(value = "alarm_intrusion")
    private Integer alarmIntrusion;

    /**
     * 水浸告警: 0-正常, 1-告警
     */
    @TableField(value = "alarm_water")
    private Integer alarmWater;

    /**
     * 环境温度 (℃)
     */
    @TableField(value = "temperature_room")
    private BigDecimal temperatureRoom;

    /**
     * 环境湿度 (%RH)
     */
    @TableField(value = "humidity_room_rh")
    private BigDecimal humidityRoomRh;

    /**
     * 视频快照链接或Base64
     */
    @TableField(value = "video_snapshot_url")
    private String videoSnapshotUrl;

    /**
     * 断路器1状态: open=分闸, closed=合闸
     */
    @TableField(value = "breaker_1_status")
    private String breaker1Status;

    /**
     * 断路器2状态: open=分闸, closed=合闸
     */
    @TableField(value = "breaker_2_status")
    private String breaker2Status;

    /**
     * 断路器3状态: open=分闸, closed=合闸
     */
    @TableField(value = "breaker_3_status")
    private String breaker3Status;

    /**
     * 变压器A相温度 (℃)
     */
    @TableField(value = "transformer_temp_a")
    private BigDecimal transformerTempA;

    /**
     * 变压器B相温度 (℃)
     */
    @TableField(value = "transformer_temp_b")
    private BigDecimal transformerTempB;

    /**
     * 变压器C相温度 (℃)
     */
    @TableField(value = "transformer_temp_c")
    private BigDecimal transformerTempC;

    /**
     * 电缆A相温度 (℃)
     */
    @TableField(value = "cable_temp_a")
    private BigDecimal cableTempA;

    /**
     * 电缆B相温度 (℃)
     */
    @TableField(value = "cable_temp_b")
    private BigDecimal cableTempB;

    /**
     * 电缆C相温度 (℃)
     */
    @TableField(value = "cable_temp_c")
    private BigDecimal cableTempC;

    /**
     * 站号
     */
    @TableField(value = "station_number")
    private Long stationNumber;
    // 指标码
    @TableField(value = "index_code")
    private String indexCode;
}